package com.kedi.homeservicecenter.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kedi.homeservicecenter.read.dao.mapper.OldhomeMapper;
import com.kedi.homeservicecenter.service.HomeServiceCenterService;

/**
 * 
 *
 * @ClassName HomeServiceCenterServiceImpl
 * @author: 陈辽逊
 * @date: 2019/7/26 11:32
 */
@Service
public class HomeServiceCenterServiceImpl implements HomeServiceCenterService {
	@Autowired
	OldhomeMapper oldhomeMapper;
	final static Logger logger = LoggerFactory.getLogger(HomeServiceCenterServiceImpl.class);

	@Override
	public List<Map<String, Object>> selectCommodity(int page,int limit) {
		try {
			List<Map<String, Object>> a = oldhomeMapper.commodity(page,limit);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}
	
	@Override
	public Map<String, Object> getCommodityDetailbyid(int id) {
		try {
			Map<String, Object> a = oldhomeMapper.getCommodityDetailbyid(id);
			return a;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("查询失败");
			return null;
		}
	}
}
